package com.liss.lissaiagent.tool;


import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Mr.Li
 * @CreateTime: 2025-10-15
 * @Description: 工具配置类
 * @Version: 1.0
 */
@Configuration
public class ToolRegistration {

    @Value("${search-api.api-key}")
    private String apiKey;

    @Bean
    public ToolCallback[] allTools(){
        FileOpertionTool fileOpertionTool = new FileOpertionTool();
        PDFGenerationTool pdfGenerationTool = new PDFGenerationTool();
        ResourceDownloadTool resourceDownloadTool = new ResourceDownloadTool();
//        TerminalOperationTool terminalOperationTool = new TerminalOperationTool();
        WebScrapingTool webScrapingTool = new WebScrapingTool();
        WebSearchTool webSearchTool = new WebSearchTool(apiKey);
        return ToolCallbacks.from(
                fileOpertionTool,
                pdfGenerationTool,
                resourceDownloadTool,
//                terminalOperationTool,
                webScrapingTool,
                webSearchTool
        );
    }
}